Skip to content

fix(server): stop the adapter and runtime tests hanging on stale approval and snooze behavior - #152

Merged
nullStack65 merged 3 commits into
release/native-0.1.10from
fix/server-test-timeouts
Nov 21, 2026
Merged

nullStack65 merged 3 commits into
release/native-0.1.10from
fix/server-test-timeouts

Conversation

@nullStack65

@nullStack65 nullStack65 commented Nov 20, 2026 •

Copy link
Copy Markdown
Owner

Summary

  • The apps/server adapter and runtime tests that hung for 120 seconds were waiting on behavior the code no longer has. A full-access thread whose workspace disables Claude bypass opens its session in a lower mode, but the approval disposition auto-allowed every command from the thread's policy alone, so no approval request was ever emitted and the caller waited until the test timeout. The allow follows the thread's policy, so a downgraded session still runs the command, matching the in-product notice that says full access will not wait for approval. A removal check or a permission-rule denial still fails the command immediately in every mode a full-access thread can open.
  • The usage-limit tests still armed recovery with the snooze flag that the usage-limit change stopped honoring, so they asserted a thread was hidden when the command returns nothing. They now arm through auto-resume and apply the snooze as the per-thread snooze, which is the only way left to hide a thread, and the projection test checks the candidate query directly instead of filtering it through that command.

What was actually failing

The reported six timeouts reproduced as three hangs and four fast assertion failures from two causes, not as leaked timers or a hung subprocess. Three hangs are in ClaudeAdapterV2.test.ts ("keeps late MCP display metadata" and the restricted-tools phases), where the test waits on an approval request the callback never emits. One fast failure is the full-access policy case in the same file. Two are in runtimeLayer.test.ts ("guards a scheduled usage-limit continuation") and one related one is in ProjectionStore.test.ts ("does not freshly arm limit recovery for a subagent of a put-away parent"). No native-fork test timed out.

Verification

  • vp test run src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts: 460 passed.
  • The usage-limit and projection cases: 24 passed.
  • The three affected files together: 700 passed, with one failure that is not from this change. runtimeLayer.test.ts:2297 ("wakes an idle coordinator for its task's question while another's lock is busy") asserts an event order and receives it reversed. It fails on the base commit as well, far from the edited lines, and is left as a known flake.
  • vp run --filter t3 typecheck: exit 0, no errors. It still prints the pre-existing suggestion TS377141 diagnostics, which do not fail the build.

Review

One independent review round, on grok-4.7 through the grok-direct provider. The preferred provider was out of usage until 2026-11-21 17:48 UTC, so the round ran on the same model through a different provider. The round found one defect: the first version gated the auto-allow on the session's own permission mode, so a downgraded full-access session asked again while the notice still said it would not. That is corrected in the follow-up commit, which restores the policy-based allow and asserts the allow decision in the tests that were waiting. The model the run actually executed was not reported by the provider.

Deploy: none

Model: grok/grok-4.7
Task: fix

🤖 Generated with Claude Code

Intent coverage

Owner: #146 · source ledger docs/delivery/request-ledger/t3code-server-timeouts/pr-intent.json · ledger sha256 e0cb6b8db0dcec6fa7b9d1724bc13e1f3ad0bb18c2962158e0300830feccf893
Head/base: recomputed from Git by CI on every push; changing the ledger requires regenerating this section.

Requirement State Files / checks Remaining / qualification
R1: Stop the apps/server adapter and runtime tests hanging or failing on stale approval and snooze behavior unresolved — The task arrived as an agent handoff with no user-authored source, so this stays a proposal and lists no files or checks. The work is done and checked: ClaudeAdapterV2.test.ts passed 460, the usage-limit and projection cases passed 24, the three affected files together passed 700 with one pre-existing ordering failure at runtimeLayer.test.ts:2297, and the server typecheck reported no errors. The changed files are listed under unrequested until a user accepts the proposal.

Sources: H1=agent_handoff/agent/public
Corrections: none recorded
Unrequested: apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.ts: Changed to carry out the proposed fix; pending acceptance of requirement R1.; apps/server/src/orchestration-v2/Adapters/ClaudeAdapterV2.test.ts: Changed to carry out the proposed fix; pending acceptance of requirement R1.; apps/server/src/orchestration-v2/runtimeLayer.test.ts: Changed to carry out the proposed fix; pending acceptance of requirement R1.; apps/server/src/orchestration-v2/ProjectionStore.test.ts: Changed to carry out the proposed fix; pending acceptance of requirement R1.; docs/delivery/request-ledger/t3code-server-timeouts/pr-intent.json: Changed to carry out the proposed fix; pending acceptance of requirement R1.
Non-goals: Fixing the pre-existing wake-ordering flake at runtimeLayer.test.ts:2297, which fails independently of this change.; Merging the pull request or changing deployment.; Changing the usage-limit recovery behavior itself; only the tests that assumed the removed snooze arming were updated.

Mechanical completeness is checked; semantic adequacy and human authority require independent exact-head review. Source recorded, implemented, CI green, accepted, merged and installed are separate states.

nullStack65 and others added 2 commits November 20, 2026 21:19
…it tests stop waiting on snooze

A full-access thread whose workspace disables Claude bypass opens its session in
auto mode. The approval disposition treated the thread's policy as bypass and
auto-allowed the command, so the permission callback returned before any request
existed and the tests waiting on one hung until the 120s timeout. Full access now
runs the command only while the session itself is in bypass. A downgraded session
asks, and a removal check or deny rule still fails closed in every mode.

The usage-limit tests still asked the recovery command to snooze a thread, which
a limit no longer does. They snooze through the per-thread snooze instead, and the
projection test checks the candidate query rather than the worker's arming.

Model: grok/grok-4.7
Task: fix
Agent: CoS delegate
Harness: t3/claude-code
Lane: magpie
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Model: grok/grok-4.7
Task: fix
Agent: CoS delegate
Harness: t3/claude-code
Lane: magpie
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Nov 20, 2026 •

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

…s lower

The downgrade is the workspace disabling bypass, and the in-product notice says
a full-access thread will not wait for approval. Gating the auto-allow on the
session's own permission mode made a downgraded session ask again, which is the
wait the earlier change removed. The allow follows the thread's policy again. A
removal check or a deny rule still fails the command immediately.

The tests that waited on an approval request for a downgraded full-access
session now assert the allow decision instead. That request is never created,
so the wait was the timeout.

Model: grok/grok-4.7
Task: fix
Agent: CoS delegate
Harness: t3/claude-code
Lane: magpie
Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
@nullStack65

nullStack65 commented Nov 21, 2026 •

Copy link
Copy Markdown
Owner Author

START / checkpoint: Voice + founder inbox (Linux ARC) on head 047cd705b7e059d7dd42ee56322c7c5de1902e79.

The failed job 136583394754 (run 44821547733, attempt 1, runner t3code-ci-arc-s5fvz-runner-d6lbh) finished the test step with exit 1. The only test failure was a 15s timeout in apps/web/src/components/chat/chatViewSend.test.ts at line 362. This PR changes server adapter and runtime tests only (ClaudeAdapterV2, ProjectionStore.test.ts, runtimeLayer.test.ts). The same chat-send timeout hit unrelated heads in the same DiskPressure window.

Reran the failed job only. Attempt 2 is queued as job 136660650582. No code change. Not merged.

Model: grok-4.7
Task: ci-rerun

@nullStack65
nullStack65 merged commit 8552cf0 into release/native-0.1.10 Nov 21, 2026
3 of 6 checks passed
@nullStack65
nullStack65 deleted the fix/server-test-timeouts branch November 21, 2026 01:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant